#include "TcpServer.h"

TcpServer::TcpServer(const uint16_t port)
{
    acceptor_ = new Acceptor(&loop_, port);
    acceptor_->setnewConnectionCb(std::bind(&TcpServer::newconnection,this,std::placeholders::_1));
}
TcpServer::~TcpServer()
{
}

void TcpServer::start()
{
    loop_.run();
}

void TcpServer::newconnection(Sock *clientSock)
{
    Connection* conn = new Connection(&loop_,clientSock);
}